package com.appspot.squashstats.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@XmlRootElement
public class User implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	private String email;

	private String name;
	
	public User() {
	}

	public User(String name, String email) {
	    super();
	    this.name = name;
	    this.email = email;
    }

	public User(com.google.appengine.api.users.User user) {
		this(user.getNickname(), user.getEmail());
	}

	public String getName() {
    	return name;
    }

	public void setName(String name) {
    	this.name = name;
    }

	public String getEmail() {
    	return email;
    }

	public void setEmail(String email) {
    	this.email = email;
    }

	@Override
    public String toString() {
	    return "User [name=" + name + ", email=" + email + "]";
    }
	
}